API Documentation
Public Member Functions | List of all members
nkGraphics::GlobalTimer Class Reference

A timer, giving time capabilities. More...

Public Member Functions

 GlobalTimer ()
 
 ~GlobalTimer ()
 
void setModuloTime (DWORD moduloTime)
 
void updateFrameTime ()
 
unsigned long getDeltaTime () const
 
unsigned long getFrameTime () const
 
unsigned long getCurrentModuloTime () const
 
unsigned long getCurrentModulo () const
 
bool getLoopedSinceLastTime () const
 
int getCurrentYear ()
 
int getCurrentMonth ()
 
int getCurrentDay ()
 
int getCurrentHour ()
 
int getCurrentMin ()
 
int getCurrentSec ()
 

Detailed Description

A timer, giving time capabilities.

Constructor & Destructor Documentation

◆ GlobalTimer()

nkGraphics::GlobalTimer::GlobalTimer ( )

Constructor.

◆ ~GlobalTimer()

nkGraphics::GlobalTimer::~GlobalTimer ( )

Destructor.

Member Function Documentation

◆ setModuloTime()

void nkGraphics::GlobalTimer::setModuloTime ( DWORD  moduloTime)

Sets the time modulo the timer will have. In a nutshell, timer will loop its time according to this modulo : [0, modulo].

Parameters
moduloTimeThe modulo to use.

◆ updateFrameTime()

void nkGraphics::GlobalTimer::updateFrameTime ( )

Updates the frame time.

◆ getDeltaTime()

unsigned long nkGraphics::GlobalTimer::getDeltaTime ( ) const
Returns
The delta time between the two last updates.

◆ getFrameTime()

unsigned long nkGraphics::GlobalTimer::getFrameTime ( ) const

The frame time, corresponding to the absolute time counter.

◆ getCurrentModuloTime()

unsigned long nkGraphics::GlobalTimer::getCurrentModuloTime ( ) const
Returns
The current modulo time, aka the frame time % modulo.

◆ getCurrentModulo()

unsigned long nkGraphics::GlobalTimer::getCurrentModulo ( ) const
Returns
The modulo currently applied.

◆ getLoopedSinceLastTime()

bool nkGraphics::GlobalTimer::getLoopedSinceLastTime ( ) const
Returns
If the last update, while updating the time, made a loop based on the modulo.

◆ getCurrentYear()

int nkGraphics::GlobalTimer::getCurrentYear ( )
Returns
The year.

◆ getCurrentMonth()

int nkGraphics::GlobalTimer::getCurrentMonth ( )
Returns
The month.

◆ getCurrentDay()

int nkGraphics::GlobalTimer::getCurrentDay ( )
Returns
The day.

◆ getCurrentHour()

int nkGraphics::GlobalTimer::getCurrentHour ( )
Returns
The hour.

◆ getCurrentMin()

int nkGraphics::GlobalTimer::getCurrentMin ( )
Returns
The min.

◆ getCurrentSec()

int nkGraphics::GlobalTimer::getCurrentSec ( )
Returns
The seconds.

The documentation for this class was generated from the following file: